<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="../../static/css/vipcenter.css">
    <script src="../../static/js/jquery-1.8.3.min.js"></script>
    <script src="../../static/js/city.js/cityJson.js"></script>
    <script src="../../static/js/city.js/citySet.js"></script>
    <script src="../../static/js/city.js/Popt.js"></script>
    <script src="../../static/js/user_center.js"></script>
    <title>Wopop</title>
    <link href="../../static/Wopop_files/style_log.css" rel="stylesheet" type="text/css">

</head>
<body>
<!--个人中心首页 -->
<div class="thetoubu">
    <!--头部-->
    <div class="thetoubu1">
        <b>
            <img src="../../static/img/touxiang.png"/>
        </b>
        <em>{{ data.user_info.user_id }}</em>
        <em>欢迎来到会员中心</em>
        <a href="#">地址管理</a>
        <a href="#">修改资料</a>
        <h5>账户安全</h5>
        {% if data.user_info.status==1 and data.user_info.mobile_status ==1 %}
            <strong>高</strong>
            <span>
        	<p style=" width:100%"></p>
        </span>
        {% elif data.user_info.status==1 or data.user_info.mobile_status ==1 %}
            <strong>中</strong>
            <span>
        	<p style=" width:50%"></p>
        </span>
        {% else %}
            <strong>低</strong>
            <span>
        	<p style=" width:27%"></p>
        </span>
        {% endif %}
        <a href="#">安全等级提升</a>
        <em style=" padding-right:2px">手机</em>
        <a href="#" style=" padding-left:2px; float:left; display:block; color:#f00" title="点击绑定">未绑定</a>

    </div>
    <div class="xiangxilbnm">
        <!--left-->
        <div class="liefyu">
            <h2>交易管理</h2>
            <div class="conb">
                <a href="/user/my_shopcar">我的购物车</a>
                <a href="#">实物交易订单</a>
                <a href="#">虚拟兑换订单</a>
                <a href="/user/collection">我的收藏</a>
                <a href="#">交易评价/晒单</a>
                <a href="#">账户余额</a>
                <a href="#">我的积分</a>
                <a href="#">我的代金卷</a>
            </div>
            <h2>客户服务</h2>
            <div class="conb">
                <a href="#">退款及退货</a>
                <a href="#">交易投诉</a>
                <a href="#">商品咨询</a>
                <a href="#">违规举报</a>
                <a href="#">平台客服</a>
                <a href="#">商家入驻</a>
            </div>
            <h2>资料管理</h2>
            <div class="conb">
                <a href="/user/base_user">账户信息</a>
                <a href="#">账户安全</a>
                <a href="/user/goods_addr">收货地址</a>
                <a href="#">我的消息</a>
                <a href="#">我的好友</a>
                <a href="/user/zfmm">支付密码</a>
                <a href="/user/binding">手机绑定</a>
                <a href="/user/e_mail">邮箱绑定</a>
            </div>
        </div>

        <div class="login" mycollectionplug="bind">
            <div class="login_m">
                <div class="login_boder">

                    <div class="login_padding" id="login_model">

                        <h2>原密码</h2>
                        <label>
                            <input type="password" id="oldpassword" class="txt_input txt_input2">
                        </label>
                        <h2>新密码</h2>
                        <label>
                            <input type="password" name="textfield2" id="newpassword" class="txt_input">
                        </label>
                        <div class="rem_sub">
                            <label>
                                <input type="button" class="sub_button" name="button" id="button" value="提交"
                                       style="opacity: 0.7;">
                            </label>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
    <br> <br>

</div>
</div>
</body>
</html>

<script>
    $(function () {
        $('.sub_button').click(function (e) {
            var oldpassword = $('#oldpassword').val();
            var newpassword = $('#newpassword').val();

            var params = {
                'old_password': oldpassword,
                'new_password': newpassword
            };

            $.ajax({
                url: '/passport/new_password',
                type: 'post',
                contentType: 'application/json',
                data: JSON.stringify(params),
                success: function (data) {
                    if (data.errno == '0') {
                        alert('修改成功')
                        location.href = '/passport/login'
                    } else {
                        alert(data.errmsg)
                    }
                }
            })
        })
    })


</script>